
from .base import BaseProvider, ProviderUserInfo


class ORCIDProvider(BaseProvider):
    def get_user_info(self, token: dict) -> ProviderUserInfo:
        aai_client = self.get_oidc_client()
        user_info = aai_client.userinfo(token=token)
        true_name = self.combine_full_name(last_name=user_info['family_name'], first_name=user_info['given_name'])
        return ProviderUserInfo(
            external_id=user_info['sub'],
            true_name=true_name,
            org_name='',
            email=''
        )
